<?php

$rfid_status = fopen("rfid_status", "w");
fwrite($rfid_status, "2");
fclose($rfid_status);

$arr = @array ('name'=>strval(trim($_POST['name'])),'locker'=>intval($_POST['locker']),'machine'=>intval($_POST['machine']));

$rfid_data = fopen("rfid_data", "w");
fwrite($rfid_data, json_encode($arr));
fclose($rfid_data);

while(file_get_contents("rfid_status") != 0) {
	sleep(1);
}

?>